import _ from "lodash"

export const isValidString = value => _.isString(value) && value.length > 0

export const isTrimValidString = value => _.isString(value) && value.trim().length > 0

export const decode = value => {
	try {
		return JSON.parse(value)
	} catch (error) {
		try {
			return eval("(" + value + ")")
		} catch (error) {}
	}
	return null
}
